var { appUtils, gUtils } = require("../utils");

function main(appName, type) {
  var noClose = false;
  var closeRecent = true;
  var closeAll = false;
  if (type == 1) {
    noClose = true;
    closeRecent = false;
    closeAll = false;
  }
  if (type == 2) {
    noClose = false;
    closeRecent = false;
    closeAll = true;
  }
  if (closeRecent) {
    appUtils.closeRecent();
  }
  if (closeAll) {
    appUtils.closeAll();
  }
  if (appName) {
    gUtils.sleep(2, 3);
    appUtils.openApp(appName);
  }
}
Wang.main = main;
